home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / WIN / VB_DB / PROFIT.ZIP / DELIGLBL.BAS < prev    next >
Encoding:
BASIC Source File  |  1993-09-23  |  5.3 KB  |  169 lines

  1. ' ********************************************************
  2. ' *       GLOBAL DECLARATIONS                            *
  3. ' ********************************************************
  4.     Global SavedPointer As Integer
  5.     Global PrintCancelFlag As Integer
  6.     Global ReportSelection As Integer
  7.     Global ActiveTransaction As Integer
  8.     Global NumberOfCopies As Integer
  9.  
  10.     Global Const KEY_LEFT = &H25
  11.     Global Const KEY_UP = &H26
  12.     Global Const KEY_RIGHT = &H27
  13.     Global Const KEY_DOWN = &H28
  14.     Global Const KEY_PAGE_UP = &H21
  15.     Global Const KEY_PAGE_DOWN = &H22
  16.     Global Const KEY_F1 = &H70
  17.     Global Const KEY_F2 = &H71
  18.     Global Const KEY_F3 = &H72
  19.     Global Const KEY_F4 = &H73
  20.     Global Const KEY_F5 = &H74
  21.     Global Const KEY_F6 = &H75
  22.     Global Const KEY_F7 = &H76
  23.     Global Const KEY_F8 = &H77
  24.     
  25. 'Fonts Dialog Flags
  26.     Global Const CF_SCREENFONTS = &H1&
  27.     Global Const CF_PRINTERFONTS = &H2&
  28.     Global Const CF_BOTH = &H3&
  29.     Global Const CF_SHOWHELP = &H4&
  30.     Global Const CF_INITTOLOGFONTSTRUCT = &H40&
  31.     Global Const CF_USESTYLE = &H80&
  32.     Global Const CF_EFFECTS = &H100&
  33.     Global Const CF_APPLY = &H200&
  34.     Global Const CF_ANSIONLY = &H400&
  35.     Global Const CF_NOVECTORFONTS = &H800&
  36.     Global Const CF_NOSIMULATIONS = &H1000&
  37.     Global Const CF_LIMITSIZE = &H2000&
  38.     Global Const CF_FIXEDPITCHONLY = &H4000&
  39.     Global Const CF_WYSIWYG = &H8000&                        'must also have CF_SCREENFONTS & CF_PRINTERFONTS
  40.     Global Const CF_FORCEFONTEXIST = &H10000
  41.     Global Const CF_SCALABLEONLY = &H20000
  42.     Global Const CF_TTONLY = &H40000
  43.     Global Const CF_NOFACESEL = &H80000
  44.     Global Const CF_NOSTYLESEL = &H100000
  45.     Global Const CF_NOSIZESEL = &H200000
  46.     
  47.     
  48.     Global Const BOPEN = 0
  49.     Global Const BCLOSE = 1
  50.     Global Const BINSERT = 2
  51.     Global Const BUPDATE = 3
  52.     Global Const BDELETE = 4
  53.     Global Const BNEXT = 6
  54.     Global Const BPREVIOUS = 7
  55.     Global Const BFIRST = 12
  56.     Global Const BLAST = 13
  57.     Global Const BEQUAL = 5
  58.     Global Const BBEGTRANS = 19
  59.     Global Const BABOTRANS = 21
  60.     Global Const BENDTRANS = 20
  61.     Global Const BGETGE = 9
  62.  
  63. 'Printer orientation
  64.  
  65.     Type ORIENT
  66.       Orientation As Long
  67.       Pad As String * 16
  68.     End Type
  69.     Declare Function PrtOrient% Lib "GDI" Alias "Escape" (ByVal hDc%, ByVal nEsc%, ByVal nLen%, lpData As ORIENT, lpOut As Any)
  70.   
  71.     Global prtO As ORIENT
  72.  
  73. 'Configuration file layout
  74.  
  75.     Type CfgType
  76.       PrintOptNumber As Integer
  77.       FontName       As String * 80
  78.       FontSize       As Integer
  79.       TopMargin      As Integer
  80.       LeftMargin     As Integer
  81.       LabelWidth     As Integer
  82.       LabelHeight    As Integer
  83.       LabelRows      As Integer
  84.       LabelColumns   As Integer
  85.       DescriptionX   As Integer
  86.       DescriptionY   As Integer
  87.       DescriptionFS  As Integer
  88.       RecipeNoX      As Integer
  89.       RecipeNoY      As Integer
  90.       RecipeNoFS     As Integer
  91.       PriceX         As Integer
  92.       PriceY         As Integer
  93.       PriceFS        As Integer
  94.       ShelfLifeX     As Integer
  95.       ShelfLifeY     As Integer
  96.       ShelfLifeFS    As Integer
  97.       LandPortFlag   As Integer
  98.       ToolBar        As Integer
  99.     End Type
  100.  
  101.     Global CfgRec As CfgType
  102.  
  103.     Type WorkType
  104.       RecNo       As String * 6
  105.       Description As String * 30
  106.       Price       As String * 5
  107.       ShelfLife   As String * 3
  108.     End Type
  109.  
  110.     Global WorkRec As WorkType
  111.    
  112.    '****************************************************************
  113.    '*   Position Block user defined type                           *
  114.    '****************************************************************
  115.  
  116.     Type PosBlk
  117.       PBelements As String * 128
  118.     End Type
  119.  
  120.     '**********************************************************************
  121.     '*    Declare btrieve calls                                           *
  122.     '**********************************************************************
  123.  
  124.     Declare Function WBtrvInit Lib "wbtrcall.dll" (ByVal init$) As Integer
  125.     Declare Function WBtrvStop Lib "wbtrcall.dll" () As Integer
  126.     Declare Function btrcall Lib "wbtrcall.dll" (ByVal op%, Pb As PosBlk, Db As Any, Dl As Integer, ByVal Kb$, ByVal Kl%, ByVal Kn%) As Integer
  127.  
  128. Sub AbortTransaction ()
  129.     KeyBufLen% = 255
  130.     BufLen% = 1
  131.     KeyNum% = 0
  132.     St% = 0
  133.     St% = btrcall(BABOTRANS, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
  134.     ActiveTransaction = False
  135.  
  136. End Sub
  137.  
  138. Sub BeginTransaction ()
  139.     KeyBufLen% = 255
  140.     BufLen% = 1
  141.     KeyNum% = 0
  142.     St% = 0
  143.     St% = btrcall(BBEGTRANS, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
  144.     ActiveTransaction = True
  145.     If St% <> 0 Then
  146.       Msg$ = "Transaction Begin failed. Status = " + Str$(St%)
  147.       T1% = MsgBox(Msg$, 0, "Warning!")
  148.     End If
  149.  
  150. End Sub
  151.  
  152. Sub EndTransaction ()
  153.     KeyBufLen% = 255
  154.     BufLen% = 1
  155.     KeyNum% = 0
  156.     St% = 0
  157.     St% = btrcall(BENDTRANS, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
  158.     ActiveTransaction = False
  159. End Sub
  160.  
  161. Sub Main ()
  162.     Screen.MousePointer = 11
  163.     AboutBox.Show 0
  164.     AboutBox!Command1.Visible = False
  165.     t% = DoEvents()
  166.     Load DeliMain
  167. End Sub
  168.  
  169.